package com.exam.system.service.impl;

import com.exam.system.dao.ExamPaperQuestionDao;
import com.exam.system.service.ExamPaperQuestionService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName ExamPaperQuestionServiceImpl
 * @Description 试卷题目中间表业务层
 * @Author ckl
 * @DATE 2021/6/2 23:58
 * @versions 1.0
 */
@Service
@Transactional
public class ExamPaperQuestionServiceImpl implements ExamPaperQuestionService {
    @Autowired
    private ExamPaperQuestionDao examPaperQuestionDao;

    /**
     * 添加试卷和题目在中间表的id
     */
    @Override
    public void addExamPaperQuestionByQuesId(Integer paperId, List<Integer> quesIdList) {
        examPaperQuestionDao.addExamPaperQuestionByQuesId(paperId, quesIdList);
    }

    /**
     * 根据试卷id删除所有的题目
     * @param id
     */
    @Override
    public void delExamPaperQuestionByPaperId(Integer id) {
        examPaperQuestionDao.delExamPaperQuestionByPaperId(id);
    }
}
